package com;

import java.util.Scanner;

public class Main{

    public String isWin;

    public static void main(String[] args) {
        System.out.println("开始游戏请按0");
        Scanner input = new Scanner(System.in);
        int a = input.nextInt();
        Main main = new Main();
        NGuessNumber nGuessNumber = new NGuessNumber();

        while (a == 0) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            switch (main.isWin) {
                case "true":
                    System.out.println("恭喜你，你获胜了！");
                    break;
                case "false":
                    System.out.println("很遗憾，你失败了！");
                    break;
            }
            System.out.println("继续游戏请按0，结束游戏请按1");
            int b = input.nextInt();
            if (b==1){
                break;
            }
        }

    }

}


